function playerObj(playerContainer,videoID){
	this.currentTime = 0;

	function updateytplayerInfo(){
		currentTime = parseInt(playerContainer.tubeplayer("data").currentTime);
		$("#test").html(currentTime);
		animation();
	}

	this.play = function(){
		playerContainer.tubeplayer("play");
	}

	this.seek = function(time){
		playerContainer.tubeplayer("seek",time);
	}

	this.getdata = function(){
		alert(dump(playerContainer.tubeplayer("data")));
		/*   
			'bytesLoaded' => "2552105"
			'bytesTotal' => "44472582"
			'startBytes' => "24124693"
			'state' => "2"
			'currentTime' => "5.958"
			'duration' => "940.042"
			'videoURL' => "http://www.youtube.com/watch?feature=player_embedded&v=e4wq-t3uGCE"
			'videoID' => "e4wq-t3uGCE"
		*/    
	}

	function dump(arr,level) {
		var dumped_text = "";
		if(!level) level = 0;
		
		//The padding given at the beginning of the line.
		var level_padding = "";
		for(var j=0;j<level+1;j++) level_padding += "    ";
		
		if(typeof(arr) == 'object') { //Array/Hashes/Objects 
			for(var item in arr) {
				var value = arr[item];
				
				if(typeof(value) == 'object') { //If it is an array,
					dumped_text += level_padding + "'" + item + "' ...\n";
					dumped_text += dump(value,level+1);
				} else {
					dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
				}
			}
		} else { //Stings/Chars/Numbers etc.
			dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
		}
		return dumped_text;
	}
	
	playerContainer.tubeplayer({
		width: 320, // the width of the player
		height: 240, // the height of the player
		allowFullScreen: true, // true by default, allow user to go full screen
		//autoPlay: true,
		initialVideo: videoID, // the video that is loaded into the player
		preferredQuality: "large",// preferred quality: default, small, medium, large, hd720
		//showRelated: 1, // show the related videos when the player ends, 0 or 1 
		onPlay: function(id){}, // after the play method is called
		onPause: function(){}, // after the pause method is called
		onStop: function(){}, // after the player is stopped
		onSeek: function(time){}, // after the video has been seeked to a defined point
		onMute: function(){}, // after the player is muted
		onUnMute: function(){}, // after the player is unmuted
		onPlayerEnded: function(){}, // when the player returns a state of ended
		onPlayerUnstarted: function(){
			setInterval(updateytplayerInfo, 1000);
			updateytplayerInfo();
		}, // when the player returns a state of ended
		onPlayerBuffering: function(){}, // when the player returns a state of buffering
		onQualityChange: function(quality){}, // a function callback for when the quality of a video is determined
	});
}